$OpenBSD: patch-gcc_config_openbsd-libpthread_h,v 1.4 2012/08/28 23:39:12 sthen Exp $
--- gcc/config/openbsd-libpthread.h.orig	Sun Sep 27 09:20:23 2009
+++ gcc/config/openbsd-libpthread.h	Sat Aug 25 09:28:37 2012
@@ -18,5 +18,5 @@
    along with GCC; see the file COPYING3.  If not see
    <http://www.gnu.org/licenses/>.  */
 
-#define OBSD_LIB_SPEC "%{!shared:%{pthread:-lpthread} -lc}"
+#define OBSD_LIB_SPEC "%{pthread:-lpthread%{!shared:%{p|pg:_p}}} %{!shared:-lc%{p:_p}%{!p:%{pg:_p}}}"
 
